<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="vue.js" type="text/javascript" charset="utf-8"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.js"></script>
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div class="" v-for="item in listData" v-if="!hideList">
            <img v-bind:src="item.images[0]" alt="" srcset="">
            <h2 v-on:click="getListDetail">{{ item.title }}</h2>
        </div>

        <div class="111">
            <img v-bind:src="detailData.images" alt="" srcset="">
            <h1>{{ detailData.title }}</h1>
            <p>{{ detailData.content }}</p>
        </div>
    </div>
</body>

<script>
    new Vue({
        el: '#app',
        data() {
            return {
                listData: [],
                detailData: {},
                hideList: false
            }
        },
        created() {
            var _this = this
            axios.get('./list-data.json').then(function (response) {
                console.log(response.data.stories)
                _this.listData = response.data.stories
            })
        },
        methods: {
            getListDetail() {
                var _this = this
                axios.get('./detail-data.json').then(function (response) {
                    _this.detailData = response.data
                    _this.hideList = true
                    console.log(response.data)
                })
            }
        }
    })

</script>

</html>